package com.fuyao.cloud.asset.vo.purchaseorder;

import cn.hutool.core.lang.tree.Tree;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fuyao.cloud.asset.entity.AssetPurchaseorderList;
import com.fuyao.cloud.common.core.util.DictItemOption;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.compress.utils.Lists;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 采购创建对象
 *
 * @author lyhil
 */
@Data
public class PurchaseorderCreateVO {

	@ApiModelProperty(value="主键Id")
	private Long id;

	@ApiModelProperty(value="单位、部门ID")
	private Long deptId;

	@ApiModelProperty(value="部门全名称")
	private String deptFullname;

	@ApiModelProperty(value="创建人")
	private String createBy;

	@ApiModelProperty(value="创建人ID")
	private Long createId;

	@ApiModelProperty(value="创建时间")
	private LocalDateTime createTime;

	@ApiModelProperty(value="修改人")
	private String updateBy;

	@ApiModelProperty(value="修改时间")
	private LocalDateTime updateTime;

	@ApiModelProperty(value="唯一编码（用于关联附件）")
	private String unid;

	@ApiModelProperty(value="单据类型：默认为ALL{ DEVICE:资产类；CONSUMABLES：易耗品；All:混合}")
	private String type;

	@ApiModelProperty(value="单号")
	private String caseid;

	@ApiModelProperty(value="申请单ID")
	private Long parentId;

	@ApiModelProperty(value="申请单号")
	private String parentCaseid;

	@ApiModelProperty(value="批次号")
	private String batchnumber;

	@ApiModelProperty(value="合同或发票ID")
	private Long contractId;

	@ApiModelProperty(value="合同或发票编号")
	private String contractNumber;

	@ApiModelProperty(value="合同或发票名称")
	private String contractName;

	@ApiModelProperty(value="状态：默认为0{0：草稿、1：处理中、2：已审批、3：已完成、4：作废}")
	private String status;

	@ApiModelProperty(value="供应商ID")
	private Long supplierId;

	@ApiModelProperty(value="供应商名称")
	private String supplierName;

	@ApiModelProperty(value="收货信息")
	private String receivinfo;

	@ApiModelProperty(value="订购时间")
	private LocalDateTime orderDatetime;

	@ApiModelProperty(value="到货时间")
	private LocalDateTime arrivalDatetime;

	@ApiModelProperty(value="采购方式01：邀标、02：自采:03：政府采购")
	private String method;

	@ApiModelProperty(value="订单金额")
	private BigDecimal amount;

	@ApiModelProperty(value="货币类型默认人民币：人民币：、欧元：欧元、美元：美元、法元：法元")
	private String currencyType;

	@ApiModelProperty(value="订单明细")
	private String detailed;

	@ApiModelProperty(value="订单说明")
	private String explains;

	@TableField(exist = false)
	@ApiModelProperty(value="物品列表")
	private List<AssetPurchaseorderList> purchaseOrderList;

	@ApiModelProperty(value="可选项集合")
	private DictOption dictOption;

	@Data
	public static class DictOption{
		@ApiModelProperty(value="状态可选项")
		private List<DictItemOption> statusList;

		@ApiModelProperty(value="采购方式可选项")
		private List<DictItemOption> purchaseWayList;

		@ApiModelProperty(value="货币类型可选项")
		private List<DictItemOption> currencyTypeList;

		@ApiModelProperty(value="合同树集合")
		private List<Tree<Long>> contractTreeList;

		@ApiModelProperty(value="供应商树集合")
		private List<Tree<Long>> supplierTreeList;

		@ApiModelProperty(value="部门树集合")
		private List<Tree<Integer>> deptTreeList = Lists.newArrayList();
	}

}
